<?php

namespace app\mall\ui\form;

/**
 * 会员等级设置表单
 */
class MallUserLevelSettingForm
{
    public function flag()
    {
        return [
            'type' => 'input',
            'title' => '等级标识',
            'field' => 'flag',
            'validate' =>
                [
                    [
                        'required' => true,
                        'message' => '不能为空',
                    ],
                ],
        ];
    }

    public function name()
    {
        return [
            'type' => 'input',
            'title' => '等级名称',
            'field' => 'name',
            'validate' =>
                [
                    [
                        'required' => true,
                        'message' => '不能为空',
                    ],
                ],
        ];
    }

    public function min_point()
    {
        return [
            'type' => 'number',
            'title' => '达到等级最低积分',
            'field' => 'min_point',
        ];
    }

    public function icon()
    {
        return [
            'type' => 'uploadImage',
            'action' => config('thinkAdmin.upload_url'),
            'title' => '等级图标',
            'field' => 'icon',
        ];
    }

    public function rule()
    {
        return [
            'type' => 'editor',
            'title' => '规则/权益说明',
            'field' => 'rule',
            'action' => config('thinkAdmin.upload_url'),
        ];
    }
}